package com.votingsystem.entity;

public class Artwork implements Comparable<Artwork>{
    private int rank;  // 排名
    private int order;  // 顺序
    private String name;
    private String author;
    private int ticket;

    public int getRank() {
        return rank;
    }

    public void setRank(int rank) {
        this.rank = rank;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public int getTicket() {
        return ticket;
    }

    public void setTicket(int ticket) {
        this.ticket = ticket;
    }

    public int getOrder() {
        return order;
    }

    public void setOrder(int order) {
        this.order = order;
    }

    @Override
    public String toString() {
        return "Artwork{" +
                "rank=" + rank +
                ", order=" + order +
                ", name='" + name + '\'' +
                ", author='" + author + '\'' +
                ", ticket=" + ticket +
                '}';
    }

    @Override
    public int compareTo(Artwork o) {
        return this.ticket - o.getTicket();
    }
}
